﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.EquipmentManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.EquipmentManagement.EquipmentStateRecordVMs
{
    public partial class EquipmentStateRecordTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._EquipmentStateRecord._LineId")]
        public ExcelPropety LineId_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.LineId);
        [Display(Name = "_Model._EquipmentStateRecord._LineName")]
        public ExcelPropety LineName_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.LineName);
        [Display(Name = "_Model._EquipmentStateRecord._Equipment")]
        public ExcelPropety Equipment_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.EquipmentId);
        [Display(Name = "_Model._EquipmentStateRecord._EquipName")]
        public ExcelPropety EquipName_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.EquipName);
        [Display(Name = "_Model._EquipmentStateRecord._Status")]
        public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.Status);
        [Display(Name = "_Model._EquipmentStateRecord._StartTime")]
        public ExcelPropety StartTime_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.StartTime, true);
        [Display(Name = "_Model._EquipmentStateRecord._EndTime")]
        public ExcelPropety EndTime_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.EndTime, true);
        [Display(Name = "_Model._EquipmentStateRecord._Duration")]
        public ExcelPropety Duration_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.Duration);
        [Display(Name = "_Model._EquipmentStateRecord._ProuductId")]
        public ExcelPropety ProuductId_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.ProuductId);
        [Display(Name = "_Model._EquipmentStateRecord._ProductName")]
        public ExcelPropety ProductName_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.ProductName);
        [Display(Name = "_Model._EquipmentStateRecord._ActiveOee")]
        public ExcelPropety ActiveOee_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.ActiveOee);
        [Display(Name = "_Model._EquipmentStateRecord._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.IsValid);
        [Display(Name = "_Model._EquipmentStateRecord._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<EquipmentStateRecord>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Equipment_Excel.DataType = ColumnDataType.ComboBox;
            Equipment_Excel.ListItems = DC.Set<Equipment>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class EquipmentStateRecordImportVM : BaseImportVM<EquipmentStateRecordTemplateVM, EquipmentStateRecord>
    {
            //import

    }

}